package com.xgr.wonderful.activity;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.RelativeLayout;

import com.markupartist.android.widget.ActionBar;
import com.markupartist.android.widget.ActionBar.Action;
import com.xgr.wonderful.R;
import com.xgr.wonderful.activity.base.BasePageActivity;
/**
 * 先用的是进入 http://weitushare.com/weitu.html
 * @author lsj
 *
 */
public class AdActivity extends BasePageActivity {
	private WebView webView ;
	private static final String URL = "http://weitushare.com/weitu.html" ;
	private ActionBar mActionBar ;
	private RelativeLayout adNotCareRL;
	
	@Override
	protected void setLayoutView() {
		setContentView(R.layout.activity_ad_app) ;
	}

	@Override
	protected void findViews() {
		webView = (WebView)findViewById(R.id.adapp_webview) ;
		mActionBar = (ActionBar)findViewById(R.id.actionbar_adapp) ;
		adNotCareRL = (RelativeLayout)findViewById(R.id.ad_notcare);
	}

	@Override
	protected void setupViews(Bundle bundle) {
		mActionBar.setTitle("通知") ;
		mActionBar.setDisplayHomeAsUpEnabled(true) ;
		mActionBar.setHomeAction(new Action() {
			@Override
			public void performAction(View view) {
				//sputil.setIsAdShow(false) ;
				finish() ;
			}
			
			@Override
			public int getDrawable() {
				return R.drawable.weix_logo_blank;
			}
		}) ;
		
		adNotCareRL.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				sputil.setIsAdShow(false) ;
				adNotCareRL.setVisibility(View.GONE) ;
			}
		}) ;
		
		webView.loadUrl(URL) ;
		webView.getSettings().setJavaScriptEnabled(true) ;
		//下面的可以使在activity中显示，而不是打开网页

		webView.setWebViewClient(new WebViewClient()) ;
	}

	@Override
	protected void setListener() {
		// TODO Auto-generated method stub
		
	}

}
